package util;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ExecCmdHandle {

	public static String processCommand(String command) {
		StringBuffer buffer = new StringBuffer();
		try {
			String line;
			Process p = Runtime.getRuntime().exec(command);
			BufferedReader input = new BufferedReader(new InputStreamReader(
					p.getInputStream()));
			while ((line = input.readLine()) != null) {
				buffer.append(line + "\n");
			}
			input.close();
		} catch (Exception err) {
			err.printStackTrace();	
			return "";
		}
		return buffer.toString();
	}
}
